//
//  LSLiveSectionView.m
//  LookScore
//
//  Created by wws on 2018/3/23.
//  Copyright © 2018年 ChongQingXunTiCompany. All rights reserved.
//

#import "LSLiveSectionView.h"

@implementation LSLiveSectionView

- (instancetype)initWithFrame:(CGRect)frame withTitleArray:(NSArray *)titleArray{
    
    if (self = [super initWithFrame:frame]) {
        [self addContentView:titleArray];
    }
    
    return self;
    
}

- (void)addContentView:(NSArray *)titleArray{
    
    UIView *backView = [[UIView alloc] init];
    [self addSubview:backView];
        backView.sd_layout.topSpaceToView(self, 0).leftEqualToView(self).offset(0).rightEqualToView(self).offset(0).bottomEqualToView(self);
    CGFloat width=(LSScreenWidth) / titleArray.count;
    
    UILabel *lable;
    for (int i=0; i<titleArray.count; i++) {
        lable=[UILabel new];
        lable.text = titleArray[i];
        lable.textAlignment = NSTextAlignmentCenter;
        lable.textColor = LSTitleGrayColor3;
        lable.font = LSFontSize12;
        lable.tag=i;
        [backView addSubview:lable];
        lable.sd_layout.leftEqualToView(backView).offset(width*i).topSpaceToView(backView, 0).widthIs(width).heightIs(30);
    }
    
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
